import axios from "../../../utils/axios";

let api = `${baseApi}cost`;

/**
 * @method expenseLock 查询所有的费用信息(带分页)
 * @param
 * @return axios
 */
export const expenseLock = function () {
  return axios.get(`${api}/expenseLock`);
}
/**
 * @method getAllByExpenseManag 查询所有的费用信息(带分页)
 * @param
 * @return axios
 */
export const getAllByExpenseManag = function (params) {
    return axios.post(`${api}/getAllByExpenseManag`, params);
}

/**
 * @method getAllExpenseManagByCondition 条件查询所有的费用信息(带分页)
 * @param
 * @return axios
 */
export const getAllExpenseManagByCondition = function (params) {
    return axios.post(`${api}/getAllExpenseManagByCondition`, params);
}

/**
 * @method getAuditEcho 审核的回显信息获取
 * @param
 * @return axios
 */
export const getAuditEcho = function (params) {
    return axios.get(`${api}/getAuditEcho/${params}`);
}

export const getHistoricalPaymentsByExpenseManagId =function(params) {
    return axios.get(`${api}/getHistoricalPaymentsByExpenseManagId/${params}`)
}

/**
 * @method getNoticeByContractId 通过费用信息id查询费用详情
 * @param
 * @return axios
 */
export const getNoticeByContractId = function (params) {
    return axios.get(`${api}/getNoticeByContractId/${params}`);
}

/**
 * @method invoicing 通过费用信息id的字符串集合来进行开票
 * @param
 * @return axios
 */
export const invoicing = function (params) {
    return axios.get(`${api}/invoicing/${params}`);
}


/**
 * @method getInvoicing 得到发票接口返回值
 * @param
 * @return axios
 */
export const getInvoicing = function (params) {
    return axios({
        method: 'post',
        url:`${api}/getInvoicing`,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        data: params
    });
}

/**
 * @method meterReadingByExpenseManagId 通过费用信息id得到要抄表所需要回显的信息
 * @param
 * @return axios
 */
export const meterReadingByExpenseManagId = function (params) {
    return axios.get(`${api}/meterReadingByExpenseManagId/${params}`);
}

/**
 * @method meterReadingReview 抄表审核
 * @param
 * @return axios
 */
export const meterReadingReview = function (params) {
    return axios.post(`${api}/meterReadingReview`,params);
}

/**
 * @method offlineInvoicing 线下开票
 * @param
 * @return axios
 */
export const offlineInvoicing = function (params) {
    return axios.post(`${api}/offlineInvoicing`,params);
}

/**
 * @method pay 缴费
 * @param
 * @return axios
 */
export const pay = function (params) {
    return axios.post(`${api}/pay`,params);
}

/**
 * @method updateMeterReadingInformation 录入抄表信息
 * @param
 * @return axios
 */
export const updateMeterReadingInformation = function (params) {
    return axios.post(`${api}/updateMeterReadingInformation`,params);
}
